package com.example.dqnm.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class HeadImageUtils {

    @Value("${sky.alioss.endpoint}")
    public String endpoint;
    @Value("${sky.alioss.bucket-name}")
    private String bucketName;

    public String getHeadImageUrl(String objectName) {
        StringBuilder stringBuilder = new StringBuilder("https://");
        stringBuilder
                .append(bucketName)
                .append(".")
                .append(endpoint)
                .append("/")
                .append(objectName);

        return stringBuilder.toString();
    }
}
